package com.whiteape.book.contract;


import com.whiteape.book.core.page.TxtChapter;
import com.whiteape.book.model.bo.ChapterContentBo;
import com.whiteape.book.model.dto.CollectionMediaBean;
import com.whiteape.book.model.dto.MediaChapterBean;
import com.whiteape.book.model.dto.SiteSourceBean;
import com.whiteape.book.model.type.ComicLoadFlag;
import com.whiteape.book.ui.base.BaseContract;

import java.util.List;

/**
 * Created by newbiechen on 17-5-16.
 */

public interface ComicReadContract extends BaseContract {
    interface View extends BaseView {
        void showCatalog(List<MediaChapterBean> bookChapterList);
        void loadCatalogFailed();
        void updateCatalog(List<MediaChapterBean> bookChapterList);
        void updateCatalogFailed();
        void finishChapter(List<ChapterContentBo> chapterContentBoList, ComicLoadFlag flag, String cachedChapterId);
        void errorChapter();
        void lazyLoadSuccess(ChapterContentBo chapterContentBo);
        void lazyLoadFailed(ChapterContentBo chapterContentBo);
    }

    interface Presenter extends BasePresenter<View>{
        void loadWebCatalog(SiteSourceBean siteSourceBean, CollectionMediaBean mediaBean);
        void updateWebCatalog(SiteSourceBean siteSourceBean, CollectionMediaBean mediaBean);
        void loadChapter(SiteSourceBean siteSourceBean, CollectionMediaBean collectionMediaBean, List<MediaChapterBean> mediaChapterBeanList, ComicLoadFlag flag);
        void lazyLoadImage(SiteSourceBean siteSourceBean, CollectionMediaBean collectionMediaBean, ChapterContentBo chapterContentBo) ;
        void saveChapterLazyContent(String mediaId, String chapterLink, ChapterContentBo chapterContentBo);
    }
}
